package com.xuanwu.shop.util;

import java.util.Date;
import java.util.Random;
import java.text.SimpleDateFormat;

public class StringUtil {

	private final static String ID_FORMAT = "yyyyMMddHHmmssSS";

	private static SimpleDateFormat simpleDF;
	private static Random random;

	static {
		simpleDF = new SimpleDateFormat(ID_FORMAT);
		random = new Random();
	}

	public static String createId(Date date) {
		String id = simpleDF.format(date);
		id = id + (random.nextInt(900) + 100) + "";
		//System.out.println(id);
		return id;
	}

}
